Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 18, 2024

Proposed commit message

Use metadata watchers for ReplicaSets in the metricbeats Kubernetes module. This is a similar change to #41100, with two major differences:

  • State metrics for ReplicaSets may actually need all the metadata, so our transform function keeps it.
  • Due to the way the update handler function switches over the resource type, our resource needs to have TypeMeta present. The informer doesn't set this, so we need to do it ourselves.

A decent chunk of the changes is just passing around a metadata-only k8s client.

For more details see elastic/elastic-agent#5623.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

You need a full K8s cluster, unfortunately. I've tested it using the default elastic-agent standalone manifest, by building a custom container image and loading it into a local kind cluster.

Related issues


This is an automatic backport of pull request #41289 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner October 18, 2024 15:21
@mergify mergify bot added the backport label Oct 18, 2024
@mergify mergify bot requested review from constanca-m and gizas and removed request for a team October 18, 2024 15:21
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 18, 2024
@botelastic
Copy link

botelastic bot commented Oct 18, 2024

This pull request doesn't have a Team:<team> label.

@mergify
Copy link
Contributor Author

mergify bot commented Oct 21, 2024

This pull request has not been merged yet. Could you please review and merge it @swiatekm? 🙏

@swiatekm swiatekm merged commit b3abb30 into 8.x Oct 21, 2024
@swiatekm swiatekm deleted the mergify/bp/8.x/pr-41289 branch October 21, 2024 08:26
@khushijain21 khushijain21 mentioned this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant